using System;
using Csla;
using System.Collections;
namespace Manor.Business.Article
{
	[Serializable]
	public class ArticleImagesList : BusinessBindingListBase<ArticleImagesList, ArticleImages>
	{

		#region Business Methods
		protected override object AddNewCore()
		{
			var item = ArticleImages.New();
			Add(item);
			return item; 
		}

		#endregion

		#region Factory Methods
		internal static ArticleImagesList New()
		{
			return DataPortal.CreateChild<ArticleImagesList>();
		}

		internal static ArticleImagesList Get(int foreignKey)
		{
			return DataPortal.FetchChild<ArticleImagesList>(foreignKey);
		}

		private ArticleImagesList()
		{
			/* Require use of factory methods */ 
		}

		#endregion

		#region Data Access
		// ReSharper disable UnusedMember.Local
		private void Child_Fetch(int foreignKey)
		// ReSharper restore UnusedMember.Local
		{
			RaiseListChangedEvents = false;
			#warning add database select here
			IList list = null;
			foreach (var data in list)
			{
				Add(ArticleImages.Get(data));
			}

			RaiseListChangedEvents = true;
		}

		#endregion
	}

}

